package com.lu.integrate.message.center.service;

import com.lu.stack.common.model.response.R;
import com.lu.integrate.message.center.model.domain.MessageCenterQueueConsumeDo;
import com.lu.integrate.message.center.model.request.MessageCenterQueueMessageConfirmSubmitRequest;
import com.lu.integrate.message.center.model.request.MessageCenterQueueProduceRequest;
import com.lu.integrate.message.center.model.request.MessageCenterQueueRetryConsumerRequest;

/**
 * @author zhanglu
 * @project lu-cloud-stack
 * @description 消息队列接口
 * @date 2023/2/13 17:49
 */
public interface MessageQueueService {

    /**
     * 生产
     * @param produceDo
     * @return
     */
    R produce(MessageCenterQueueProduceRequest produceDo);

    /**
     * 消费
     * @param consumeDo
     * @return
     */
    R consume(MessageCenterQueueConsumeDo consumeDo);

    /**
     * 消息消费完毕，确认提交
     * @param request
     * @return
     */
    R confirmSubmit(MessageCenterQueueMessageConfirmSubmitRequest request);

    /**
     * 重试消费
     * @return
     */
    R retryConsume(MessageCenterQueueRetryConsumerRequest request);

}
